#pragma once
#include "Resource.h"
#include "FileHelper.h"
#include "Parse.h"

enum CodeType
{
	ANSI,
	UTF8,
	UTF8_NO_BOM,
	UTF16,
	AUTO
};
class FileCommon
{
public:
	static wstring ReadFile(LPCTSTR path);
	static BOOL WriteFile(LPCTSTR path, wstring value);
	static BOOL CreateFileU(LPCTSTR path, wstring value);
	static BOOL CreateFolder(wstring path);
	static BOOL RemoveFolder(wstring path);
	static BOOL ExportFile(wstring sourceDirectory, wstring sourcefile, wstring exportDirectory,BOOL isCover);
	static void CompressFiles(wstring targetDir, wstring sourceDir);
	static void ForeachFiles(string path, vector<string>& files);

	static wstring GetExtensionName(wstring fileName);
	static wstring GetDate(int moveday = 0);
	static wstring GetTime();
	static BOOL FindFile(wstring path);
	static BOOL FindFolder(wstring folderDir);
	static wstring GetModulePath();
	static long GetFileSize(LPCTSTR path);
	static vector<wstring> Split(wstring str,wchar_t ch, int sub = 0);
	static vector<wstring> Split(wstring str, wstring wstr, int sub = 0);

protected:
	static void ZipFile(string sourceDir,string sourceFileDir, HZIP hZip);
};

